<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>象牙山洗脚城</title>
    <script src="https://unpkg.com/vue@next" ></script>
</head>
<body>
    <div id="app"></div>
</body>

<script>
    Vue.createApp({   // 创建一个VUE实例
        data() {
            return {
                content: "",
                setMeal: "真空套餐 帝王套餐 夏日套餐 学生套餐",
                isShowMeal: false
            }
        },
        methods: {
            welcomeBtnClkick(){
                this.content = "欢迎你的光临，贵宾一位！"
            },
            byeBtnClick(){
                this.content = "欢迎下次光临，真空套餐下次8折优惠。"
            },
            showOrHideBtnClick(){
                this.isShowMeal = !this.isShowMeal
            }
        },
        template: `
            <div>
                <div>{{content}}</div>
                <button v-on:click="welcomeBtnClkick">有顾客来</button> &nbsp;
                <button v-on:click="byeBtnClick">顾客离开</button>
                <div>
                    <div v-if="isShowMeal">{{setMeal}}</div>
                    <button v-on:click="showOrHideBtnClick">显示/隐藏套餐</button>    
                </div>
            </div>
        `
    }).mount("#app")
</script>
</html>